<?php $msgs = Yii::app()->user->getFlash('msgs'); ?>
         <!-- START OF MAINCOL -->
          <div class="MainCol AM_BookPage">

              <h1 class="left">在线问吧管理</h1>

              <br class="clear" />
              
              <span class="NormalFont SmallFont">
                  <a href="<?php echo Yii::app()->baseUrl; ?>" title="home"><?= CHtml::image(Yii::app()->baseUrl.'/images/home_icon.gif', '主页'); ?></a> > 在线问吧 > 在线问吧管理
               </span><br /><br />
              
              <div class="Titlebox box"><!-- DON'T DELETE --></div>
              
              <?php if(isset($msgs['save'])) : ?>
              <div class="SuccessfulBox Smallbox">
                <span class="Successful"> <?php echo $msgs['save']; ?> </span>
              </div>
              <?php endif; ?>

              <?php if(Yii::app()->user->hasFlash('message')) : ?>
              <div class="SuccessfulBox Smallbox">
                <span class="Successful"> <?php echo Yii::app()->user->getFlash('message'); ?></span>
              </div>
              <?php endif; ?>
              
              <div class="DisplayBox_top Smallbox">
              
              	  <b class="left SmallFont">共 <span class="Blue"><?php echo $count; ?></span> 条记录，其中未解决 <span class="Blue"><?php echo $countUnsolved; ?></span> 条。</b>
                  
                  <?php $this->widget('CLinkPager', array('pages' => $pages)); ?>
                  
                  <br class="clear" />
              </div>
              
              <ul class="Lists Smallbox">
              <?php foreach($qAs as $k => $qA) { ?>
              	  <li <?php if($k%2 == 1) { ?>class="ThinGrey_bg"<?php } ?>>

                      <span class="ContentBox">
                          <p class="Smallbox">
	                          	<b><?php echo $qA->qaTitle; ?></b>
                          </p>
                          
                          <p class="Smallbox">
                          <label>状态</label>: <span class="<?php if($qA->qaStatus == QAs::STATUS_UNSOLVED) : echo 'Red'; elseif($qA->qaStatus == QAs::STATUS_SOLVED): echo 'Green'; endif; ?>"><?php echo $qA->getStatusText(); ?></span><br />
                          <label>作者</label>: <a href="<?php echo CHtml::normalizeUrl(array('/users/viewprofile', 'id' => $qA->author->uid)) ?>" target="_blank" class="BlueLink"><?php echo $qA->author->userName(); ?></a><br />
                          <label>发布日期</label>: <?php echo date('y年m月d日 h:i', $qA->qaDate); ?><br />
                          <label>回复数量</label>: <?php echo $qA->count('qaParent = '.$qA->qaId); ?><br />
                          <label>提问内容</label>: <?php echo truncStr($qA->qaContent, 210, '...'); ?><br />
                          <label><?php echo $qA->qaStatus == QAs::STATUS_UNSOLVED ? CHtml::link('回复', array('/qas/view/id/'.$qA->qaId), array('class' => 'BlueLink', 'target' => '_blank')).'/' : ''; ?><?php echo CHtml::link('回复管理', array('/admin/qas/repliesmanage', 'id' => $qA->qaId), array('class' => 'BlueLink')) ?></label><br />
                          <label><?php echo CHtml::link($qA->qaStatus == QAs::STATUS_UNSOLVED ? '设置为已解决' : '设置为未解决', array('/admin/qas/togglestatus', 'id' => $qA->qaId), array('class' => 'BlueLink')); ?>&nbsp;</label><br />
                          </p>
                      </span>
                      <br class="clear" />
                      
                      <span class="Rated"><?php echo CHtml::link('删除', array('/admin/qas/delete/id/'.$qA->qaId), array('confirm' => '确定要删除这条咨询提问吗？', 'class' => 'Delete')); ?></span>
                </li>
                <?php } ?>
                
              </ul>
              
              
              <div class="DisplayBox_btm">
              
              	  <b class="left SmallFont">共 <span class="Blue"><?php echo $count; ?></span> 条记录，其中未解决 <span class="Blue"><?php echo $countUnsolved; ?></span> 条。</b>
                  
                  <?php $this->widget('CLinkPager', array('pages' => $pages)); ?>
                  
                  <br class="clear" />       
              </div>
              
        </div>
          <!-- END OF MAINCOL -->